package org.sith.gl.taskmanager.client;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.VerticalPanel;

public abstract class AbstractVerticalPane extends VerticalPanel {
    protected Button refreshButton = new Button("Refresh");

    protected AbstractVerticalPane() {
        refreshButton.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent clickEvent) {
                initData();
            }
        });
        RootPanel.get(getPagePosition()).add(this);
    }

    public void makeWidget() {


        initData();


    }


    protected abstract void initData();

    protected abstract String getPagePosition();
}
